from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

SQLALCHEMY_DATABASE_URL = 'mysql://root:Luohao.618@47.104.31.138:3306/hrs?charset=utf8mb4'
# SQLALCHEMY_DATABASE_URL = "mysql+pymysql://root:Luo.618@47.104.31.138:3306/hrs?charset=utf8mb4"

engine = create_engine(SQLALCHEMY_DATABASE_URL, echo=True)
# 获得数据库会话工厂（通过调用该对象就可以获得数据库会话对象）
db_session_factory = sessionmaker(autocommit=False, autoflush=False, bind=engine)

Base = declarative_base()
